import collections
class Solution(object):
    def frequencySort(self, nums):
        d = collections.Counter(nums)
        nums.sort(key=lambda x: (d[x], -x))
        return nums
